package com.yu.waterstation.common.handler;

import lombok.Data;

@Data
public class ServiceException extends Exception {

    private int code = 400;

    public ServiceException(String msg) {
        super(msg);
    }


    public ServiceException(String msg, int code) {
        super(msg);
        this.code = code;
    }


    public final static ServiceException CONST_token_is_not_belongs_to_current_user =
            new ServiceException("token不是当前用户的");

    public final static ServiceException CONST_verify_code_error_or_expire =
            new ServiceException("验证码错误或已失效");

    public final static ServiceException CONST_user_not_exist =
            new ServiceException("用户不存在");

    public final static ServiceException CONST_user_is_forbidden =
            new ServiceException("用户已被冻结");

    public final static ServiceException CONST_user_not_login =
            new ServiceException("用户未登录", 10001);

    public final static ServiceException CONST_user_login_expired =
            new ServiceException("用户登录已过期", 10001);

    public final static ServiceException CONST_token_is_not_validate =
            new ServiceException("token无效", 10001);

    public final static ServiceException CONST_not_authorized =
            new ServiceException("权限不足", 10002);

    public final static ServiceException CONST_login_failed =
            new ServiceException("账号不存在或密码错误");
    public final static ServiceException CONST_image_upload_failed =
            new ServiceException("图片上传失败");


    // ******************* 管理员管理 **************** //
    public final static ServiceException CONST_can_not_change_role_of_super_system_admin_user =
            new ServiceException("无法修改超级管理员");

    //************ 修改密码
    public final static ServiceException CONST_password_pattern_error =
            new ServiceException("密码格式不合法");
    public final static ServiceException CONST_new_password_can_not_equals_old_password =
            new ServiceException("新密码不能和旧密码一样");
    public final static ServiceException CONST_old_password_error =
            new ServiceException("旧密码错误");


    public final static ServiceException CONST_studentNo_has_exists =
            new ServiceException("学号已存在");

    public final static Exception CONST_phone_exists =
            new ServiceException("手机号已存在");

    public final static Exception CONST_phone_can_not_be_empty =
            new ServiceException("手机号码不能为空");

    public final static ServiceException CONST_visitor_mode_can_not_do_modify_operation =
            new ServiceException("游客模式 禁止修改操作");

    public final static ServiceException CONST_don_not_has_permission =
            new ServiceException("没有权限");

    // ******************* AddressService ******************** //
    public final static ServiceException CONST_can_not_edit_other_college_data =
            new ServiceException("无法修改其他学校的数据");

    public final static ServiceException CONST_ticket_num_is_not_enough =
            new ServiceException("水票数量不够");



}
